/***********************************************************************
 * Module:  AlterPropertyCommand.java
 * Author:  Nikola
 * Purpose: Defines the Class AlterPropertyCommand
 ***********************************************************************/

package genedit.controller;

import genedit.model.graph.Property;
import genedit.view.graph.ElementPainter;

import java.util.Set;

public class AlterPropertyCommand extends Command {
   private Set<Property> properties;
   private ElementPainter alteredElement;
   
   /** @param isUndoable */
   public AlterPropertyCommand(boolean isUndoable) {
	   super(isUndoable);
   }
   
   public void execute() {
      // TODO: implement
   }
   
   public void undo() {
      // TODO: implement
   }
   
   
   /** @pdGenerated default getter */
   public Set<Property> getProperties() {
      if (properties == null)
         properties = new java.util.HashSet<Property>();
      return properties;
   }
   
   /** @pdGenerated default iterator getter */
   public java.util.Iterator<Property> getIteratorProperties() {
      if (properties == null)
         properties = new java.util.HashSet<Property>();
      return properties.iterator();
   }
   
   /** @pdGenerated default setter
     * @param newProperties */
   public void setProperties(java.util.Collection<Property> newProperties) {
      removeAllProperties();
      for (java.util.Iterator<Property> iter = newProperties.iterator(); iter.hasNext();)
         addProperties((Property)iter.next());
   }
   
   /** @pdGenerated default add
     * @param newProperty */
   public void addProperties(Property newProperty) {
      if (newProperty == null)
         return;
      if (this.properties == null)
         this.properties = new java.util.HashSet<Property>();
      if (!this.properties.contains(newProperty))
         this.properties.add(newProperty);
   }
   
   /** @pdGenerated default remove
     * @param oldProperty */
   public void removeProperties(Property oldProperty) {
      if (oldProperty == null)
         return;
      if (this.properties != null)
         if (this.properties.contains(oldProperty))
            this.properties.remove(oldProperty);
   }
   
   /** @pdGenerated default removeAll */
   public void removeAllProperties() {
      if (properties != null)
         properties.clear();
   }
   /** @pdGenerated default parent getter */
   public ElementPainter getAlteredElement() {
      return alteredElement;
   }
   
   /** @pdGenerated default parent setter
     * @param newElementPainter */
   public void setAlteredElement(ElementPainter newElementPainter) {
      this.alteredElement = newElementPainter;
   }

}